using System;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Deepcode.Flux.Core.Services.FluxClient;


namespace Deepcode.Flux.Core.UI.Controls.Base
{
	/// <summary>
	/// BaseControl - implements base functionality for Flux admin controls
	/// </summary>
	public class BaseControl : System.Web.UI.WebControls.WebControl
	{
		/// <summary>
		/// Loads a stylesheet from the flux_client mapping
		/// </summary>
		/// <param name="ClientCSS"></param>
		/// <param name="UniqueID"></param>
		protected void LoadClientStyleSheet(string ClientCSS, string UniqueID)
		{
			Page.ClientScript.RegisterClientScriptBlock(this.GetType(), UniqueID, 
				String.Format("<link rel=\"stylesheet\" href=\"{0}\"/>",
					ClientHelper.GetFluxClientFile(ClientCSS)));
		}
		/// <summary>
		/// Loads a javascript file from the flux_client mapping
		/// </summary>
		/// <param name="ClientJS"></param>
		/// <param name="UniqueID"></param>
		protected void LoadClientScript(string ClientJS, string UniqueID)
		{
			Page.ClientScript.RegisterClientScriptInclude( UniqueID, ClientHelper.GetFluxClientFile( ClientJS ));
		}
	}
}
